/* ==================================================================   
 * Created [2009-4-27 下午11:32:55] by Jon.King 
 * ==================================================================  
 * TSS 
 * ================================================================== 
 * mailTo:jinpujun@hotmail.com
 * Copyright (c) Jon.King, 2009-2012 
 * ================================================================== 
*/

package com.jinhe.tss.component.dynproperty.entity;

import java.io.Serializable;

import javax.persistence.Embeddable;

/** 
 * <p> Def_Tab_Id.java </p> 
 * 复合主键
 */
@Embeddable  
public class PropertyTabId  implements Serializable {
 
    private static final long serialVersionUID = 2080938669288193204L;
    
    private Long defId;   //属性Id 
    private Long tabId;   //引用到该属性的tabId 
 
    public Long getDefId() {
        return defId;
    }
 
    public Long getTabId() {
        return tabId;
    }
 
    public void setDefId(Long defId) {
        this.defId = defId;
    }
 
    public void setTabId(Long tabId) {
        this.tabId = tabId;
    }
    
    public boolean equals(Object obj) {
        if(!(obj instanceof PropertyTabId))
            return false;
        
        PropertyTabId temp = (PropertyTabId) obj;
        return this.defId.equals(temp.getDefId())
                && this.tabId.equals(temp.getTabId());
    }

    public int hashCode() {
        return (this.tabId + "_" + this.defId).hashCode();
    }

    public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("defId=").append(defId).append(",tabId=").append(tabId);
        return sb.toString();
    }
}

